package com.yanqu.road.server.cmd.activity.snowgarden;

import com.yanqu.road.entity.activity.snowgarden.SnowGardenUserData;
import com.yanqu.road.entity.activity.snowgarden.config.SnowGardenConfig;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SnowGardenProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.snowgarden.SnowGardenModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.snowgarden.SnowGardenMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_SNOW_GARDEN_GET_DATA, desc = "请求冰雪游园会玩家数据")
public class SnowGardenGetCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        ret = player.getModule(SnowGardenModule.class).getData();
    }

    @Override
    public void sendData(GamePlayer player) {
        if (ret != 0) {
            SnowGardenProto.SnowGardenGetDataRespMsg.Builder builder = SnowGardenProto.SnowGardenGetDataRespMsg.newBuilder();
            builder.setRet(ret);
            player.sendPacket(ClientProtocol.U_SNOW_GARDEN_GET_DATA, builder);
        }

    }

}
